from sqlalchemy import Sequence, Column
from sqlalchemy.types import Integer, String
from sqlalchemy.orm import relationship
from __init__ import Base

class Grids(Base):

    __tablename__ = "grids"

    id = Column(Integer, Sequence('user_if_seq'), primary_key=True)
    name = Column(String(50))
    database = Column(String(50))

    widgets = relationship('Widgets')
    gridgroup = relationship('GridGroup')
    commentgrid = relationship('CommentGrid')

    def __init__(self, name, database):
        self.name = name
        self.database = database

    def __repr__(self):
        return "<Grid('%s', '%s')>" % (self.name, self.database)
